import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Index from "../views/Index"
import Archives from "../views/Archives"
import Tags from "../views/Tags"
import Types from "../views/Types"
import About from "../views/About"
import Blog from "../views/blog"
import Add from "../views/admin/Add";
import AdminIndex from "../views/admin/AdminIndex";
import Admin from "../views/Admin";
import Stats from "../views/admin/Stats";
import Login from "../views/Login";


Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        redirect: '/index',
        name: 'Home',
        component: Home,
        children: [
            {
                path: '/index',
                component: Index
            },
            {
                path: '/archives',
                component: Archives
            },
            {
                path: '/tags',
                component: Tags
            },
            {
                path: '/types',
                component: Types
            },
            {
                path: '/about',
                component: About
            },
            {
                path: '/blog',
                component: Blog
            }
        ]
    },
    {
        path: "/admin",
        redirect: "/admin/index",
        name: 'Admin',
        component: Admin,
        children: [
            {
                path: "/admin/index",
                component: AdminIndex
            },
            {
                path: '/admin/add',
                component: Add
            },
            {
                path: '/admin/stats',
                component: Stats
            }
        ]
    },
    {
        path: '/login',
        name: Login,
        component: Login
    }
]

const router = new VueRouter({
    mode: 'history',
    routes
})

export default router
